﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Section5
{
    class Program
    {
        static void Main(string[] args)
        {
            A a = new A();
            a.One();
            a.Two();

            B b = new B();
            b.One();
            b.Two();

            A c = b as A;

            c.One();
            c.Two();

            Console.ReadLine();
        }
    }

    public class A
    {
        public virtual void One()
        {
            Console.WriteLine("a one");
        }
        public void Two()
        {
            Console.WriteLine("a Two");
        }
    }

    public class B : A
    {
        public override void One()
        {
            Console.WriteLine("b one");
        }
        public new void Two()
        {
            Console.WriteLine("b two");
        }
    }
}
